<% @grouped = @contributions.group_by {|c| c.last_first_name} %>
<% @grouped.sort.each do |person,contributions| %>

	<div>
		<hr>
		<b><%= person %></b>
		<table border="0" cellspacing="3" cellpadding="3" width="100%">
			<tr>
				<th>Date</th>
				<th>Check #</th>
				<th>Amount</th>
			</tr>
			<% contributions.sort_by {|cont| cont.date}.each do |c| %>
			<tr>
				<td><%= c.date.strftime('%m/%d/%Y') rescue nil %></td>
				<td><%= c.check_num rescue nil %></td>
				<td><%= number_to_currency c.total rescue nil %></td>
			</tr>
			<% end %>
         </table>

		<div>
			<b>Totals</b>
			<table border="0" cellspacing="3" cellpadding="3">
				<tr>
					<% contributions.group_by {|f| f.fund_id}.each do |fund, gifts| %>
					<th><%= fund.name %></th>
					<% end %>
				</tr>
				<tr><td>Data</td></tr>
			</table>
		</div>

	</div>
	
<% end %>
